﻿<!--#include file="/parts/head.html" -->
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
  <h1 id="title" data-navbaractive="navallpools" class="h2">All Pools</h1>
</div>
<table id="pools" class="table"
  data-toggle="table"
  data-url="/allpools"
  data-filter-control="true"
  data-filter-show-clear="true"
  data-sort-order="desc"
  data-sort-name="Profit"
  data-cache="false"
  data-show-columns="true"
  data-show-toggle="true"
  data-show-refresh="true"
  data-icons-prefix="fa"
  data-icons="icons"
  data-detail-view="true"
  data-detail-formatter="detailFormatter"
>
  <thead>
      <tr>
          <th data-field="Name" data-sortable="true" data-filter-control="select">Pool</th>
          <th data-field="Algorithm" data-sortable="true" data-filter-control="select">Algorithm</th>
          <th data-field="CoinName" data-sortable="true" data-filter-control="select">Coin</th>
          <th data-field="Price" data-align="right" data-sortable="true" data-formatter="formatPrices">BTC/GH/Day</th>
          <th data-field="Hashrate" data-align="right" data-sortable="true" data-formatter="formatHashRate">Hashrate</th>
          <th data-field="BLK" data-align="right" data-sortable="true" data-formatter="formatBLK">TTF (min)</th>
          <th data-field="TSL" data-align="right" data-sortable="true" data-formatter="formatTSL">Last (min)</th>
          <th data-field="Host" data-sortable="true" data-filter-control="select">Host</th>
          <th data-field="Updated" data-sortable="true" data-formatter="formatDate">Last Updated</th>
      </tr>
  </thead>
</table>

<!-- End of page scripts -->
<script type="text/javascript">
    $(function () {
        function refreshTable() {
            if (!$("table#pools tr.detail-view").length) $("table#pools").bootstrapTable("refresh", { silent: true });
            window.setTimeout(refreshTable, 10000);
        }
        window.setTimeout(refreshTable, 10000);
    });

    function formatPrices(data) {
        return (data * 1000000000).toFixed(10);
    }
  
    function formatDate(data) {
        return timeSince(new Date(data));
        return new Date(parseInt(data.replace(/\D/g, ''))).toLocaleString();
    }

    function formatBLK(data) {
        if (typeof data == "undefined") return data;
        if (!data) return "Infinity"
        data = 24 / data * 60
        return data.toFixed(1)
    }

    function formatTSL(data) {
        if (typeof data == "undefined") return data;
        data = data / 60
        return data.toFixed(1)
    }
</script>
<!--#include file="/parts/foot.html" -->